package net.xiduth.game.player.dialogues;

import net.xiduth.utils.ShopsHandler;

public class Xuans extends Dialogue {

	private int npcId;

	@Override
	public void start() {
		npcId = (Integer) parameters[0];
		sendNPCDialogue(
				npcId,
				9827,
				"Hey "
						+ player.getUsername()
						+ ", I'm Xuan. I'm in charge of the Loyalty Programme, I also collect capes! What would you like?");
	}

	@Override
	public void run(int interfaceId, int componentId) {
		if (stage == -1) {
			sendOptionsDialogue("Xuan", "Show me your Aura Shop!",
					"I would like to see your other Shop!",
					"How do I get Loyalty Points?",
					"I would like to buy a Skill Cape.",
					"How many Loyalty Points do I have?");
			stage = 2;
		} else if (stage == 2) {
			if (componentId == OPTION_1) {
				ShopsHandler.openShop(player, 21);
				sendNPCDialogue(npcId, 9827, "Come back soon! You have "
						+ player.getLoyaltyPoints() + " Loyalty Points left.");
				end();
			}
			if (componentId == OPTION_5) {
				sendNPCDialogue(npcId, 9827,
						"You currently have " + player.getLoyaltyPoints()
								+ " Loyalty Points.");
				stage = 3;
			}
			if (componentId == OPTION_3) {
				sendNPCDialogue(npcId, 9827,
						"The only way to get Loyalty Points is by playing Xiduth for 30 minutes.");
				stage = 3;
			}
			if (componentId == OPTION_4) {
				ShopsHandler.openShop(player, 14);
				end();
				stage = 3;
			}
			if (componentId == OPTION_2) {
				ShopsHandler.openShop(player, 15);
				sendNPCDialogue(npcId, 9827, "Come back soon! You have "
						+ player.getLoyaltyPoints() + " Loyalty Points left.");
				end();
				stage = 3;
			}
		} else if (stage == 3) {
			end();
		}
	}

	@Override
	public void finish() {

	}

}